package com.tb.dubbo_service;

import com.tb.dubbo.ICartItemService;
import com.tb.mapper.CartItemMapper;
import com.tb.mapper.ImgMapper;
import com.tb.pojo.CartItem;
import com.tb.pojo.Img;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CartItemServiceImpl implements ICartItemService {

    @Autowired
    private CartItemMapper cartItemMapper;

    @Autowired
    private ImgMapper imgMapper;

    @Override
    public List<CartItem> selectAllCartByUser(String id) {
        List<CartItem> list = cartItemMapper.selectAllCartByUser(id);
        return list;
    }

    @Override
    public List<Img> selectPicByGoodsId(String goodsId) {
        List<Img> list = imgMapper.selectPicByGoodsId(goodsId);
        return list;
    }
}
